try datetime python

142

try datetime python -

try:
    d = datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S")
except ValueError:
    d = None

Comments

Submit
0 Comments